; (function () {

    /**
     * 构造器
     *
     * @param {object} opt
     */
    function MapSurvey(opt, chart) {
        this.myChart = chart;
        this._init(opt);
    }

    /**
     * mapSurvey地图
     */
    MapSurvey.prototype = {
        constructor: this,
        _init: function (opt) {

            // 默认参数
            var def = {
                id: '',
                path: '',
                data: {

                },
                //地图事件
                echartsMapEvent: {
                    // 点击事件
                    // click : function(areaObj){
                    //     console.log(areaObj)
                    // },
                },
                //echarts地图配置（可查官方文档）
                echartsMapOpt: {
                    title: {
                        text: '',//标题
                        subtext: '',//副标题
                        sublink: '',
                        x: 'center',
                        textStyle: {
                            color: '#fff'
                        }
                    },
                    tooltip: {
                        trigger: 'item',
                        formatter: function (params) {
                            return params.name + ((params.value[2] != '') ? '(' + params.value[2] + ')' : '');
                        }
                    },
                    geo: {
                        map: '',
                        label: {
                            normal: {
                                show: true,
                                textStyle: {
                                    color: "#fff",
                                    fontSize: 10
                                }
                            },
                            emphasis: {
                                show: false,
                                textStyle: {
                                    color: "#fff",
                                    fontSize: 10
                                }
                            }
                        },
                        itemStyle: {
                            normal: {
                                color: {
                                    type: 'radial',
                                    x: 0.5,
                                    y: 0.5,
                                    r: 1,
                                    colorStops: [{
                                        offset: 0, color: '#061c58' // 0% 处的颜色
                                    }, {
                                        offset: 1, color: '#406A8E' // 100% 处的颜色
                                    }],
                                    globalCoord: false // 缺省为 false
                                },
                                borderColor: '#82F9FF',
                                shadowColor: '#91E8F6',
                                shadowBlur: 10
                            },
                            emphasis: {
                                areaColor: '#389BB7'
                            }
                        },
                        roam: true,
                        regions: [{
                            name: '鍗楁捣璇稿矝',
                            value: 0,
                            // itemStyle: {
                            //     normal: {
                            //         opacity: 0,
                            //         label: {
                            //             show: false
                            //         }
                            //     }
                            // },
                            label: {
                                opacity: 0,
                                normal: {
                                    show: false
                                }
                            }
                        }],
                        scaleLimit: {
                            min: 1
                        }
                    },
                    series: [{
                        name: '',
                        type: 'scatter',
                        coordinateSystem: 'geo',
                        //symbol 默认图标(/echarts/echarts.min.js) 如需自定义: image://images/wisdom2.png(如工程指挥中心的智慧项目),注意isgeoroam为true时,有两处需修改设置
                        symbol: 'image://',
                        symbolSize: 12,//图标大小
                        label: {
                            normal: {
                                show: false
                            },
                            emphasis: {
                                show: false
                            }
                        },
                        itemStyle: {
                            normal: {
                                color: '#FFFF3F'
                            },
                            emphasis: {
                                color: '#FFFF3F',
                                borderColor: '#fff',
                                borderWidth: 1
                            }
                        },
                        zlevel: 12,
                    },
                    // 涟漪
                    {
                        type: 'effectScatter',
                        name: '散点动画',
                        legendHoverLink: true,
                        coordinateSystem: "geo",
                        data: [],
                        symbolSize: 14,
                        showEffectOn: "render",
                        rippleEffect: {
                            brushType: "stroke",
                        },
                        tooltip: {
                            show: false
                        },
                        hoverAnimation: true,
                        geoIndex: 0,
                        label: {
                            normal: {
                                formatter: "{b}",
                                position: "left",
                                show: false,
                            },
                        },
                        itemStyle: {
                            normal: {
                                // color: "rgba(255, 225, 0, 1)",
                                // color: "#FFE660",
                                color: '#C73B3E',
                                shadowBlur: 20,
                                shadowColor: '#C73B3E'
                                // shadowColor: "rgba(255, 225, 0, 1)",
                                // shadowColor: "#FFE660",

                            },
                        },
                        zlevel: 1,
                    }]
                },
                completed: function () {

                },
                isgeoroam: false //是否根据地图缩放比例显示节点
            }

            //合并参数
            this.mergeOpt = $.extend(true, {}, def, opt);

            //
            this.el = $('#' + this.mergeOpt.id);

            //唯一标示（没啥用）
            this.mark = this.mergeOpt.id + '-' + Math.floor((Math.random() * 100) + 1);

            //记录父级ID、Name
            this.mapStack = [];
            this.parentId = null;
            this.parentName = null;

            //Echarts地图实例
            // this.myChart = null;

            this.navArea = $('<div class="map-survey-path"><button type="button" class="back-to-china">中国</button></div>');
            this.btnBack = null;//"返回上级"按钮
            //
            this.mapBox = $('<div id="' + this.mark + '" class="map-survey-wrap"></div>');

            //中国地图（第一级地图）的ID、Name、Json数据
            this.chinaId = 100000;
            this.chinaName = "中国";
            this.chinaJson = null;
            this.chinadata = [];//按省份显示节点

            //当前json地图
            this.mapJsonNow = null;
            // 判断是否是点击进来的（涟漪）
            this.mapClickRip = false;
            //初始化
            this._initMap();
        },
        _initMap: function () {

            var _this = this;

            //布局结构生成
            _this.el.addClass('map-survey');
            _this.el.wrap(_this.mapBox);
            _this.el.before(_this.navArea);

            //默认不显示按钮
            _this.navArea.hide();

            //中国按钮点击
            _this.navArea.find('.back-to-china').on('click', function () {
                _this._back(this);
            });
            //IE11下,会出现地图所在元素高度为0的情况，导致地图显示不出来，需要重新设置高度
            if ($(_this.el).height() <= 0)
                $(_this.el).height($(_this.el).parent().height());//重新设置高度
            if ($(_this.el).height() <= 0)
                $(_this.el).height($(_this.el).parent().parent().height());//重新设置高度

            // _this.myChart = echarts.init(document.getElementById(_this.mergeOpt.id));
            _this.myZoom = 1;//默认缩放比例

            //默认加载中国地图
            $.get(
                _this.mergeOpt.path + "json/" +
                _this.chinaId + ".json",
                function (mapJson) {

                    _this.mapJsonNow = mapJson, _this.chinaJson = mapJson;
                    _this._registerAndsetOption(_this.myChart, _this.chinaId, _this.chinaName, mapJson, false);

                    _this.parentId = _this.chinaId;
                    _this.parentName = _this.chinaName;

                    //地图事件绑定
                    _this.myChart.on("click", function (param) {
                        _this.mapClickRip = true;
                        var cityId = cityMap[param.name];
                        if (param.name == '鍗楁捣璇稿矝') {
                            return false;
                        }

                        if (param.seriesType == "scatter") {
                            //
                            _this.mergeOpt.echartsMapEvent.click && _this.mergeOpt.echartsMapEvent.click(param);

                        } else if (!param.seriesType && cityId) {//省市
                            _this._setMapJson(cityId, param.name);
                        } else if (!param.seriesType && typeof (cityId) == 'undefined') {//县区等无法获取下级的地图
                            _this._setMapJsonSingle(param.name);
                        }
                        if (!_this.mergeOpt.echartsMapOpt.geo.roam) {
                            _this.mergeOpt.echartsMapOpt.geo.roam = true
                            setTimeout(() => {
                                _this.myChart.setOption(_this.mergeOpt.echartsMapOpt);
                            }, 1000);
                        }
                    });
                    if (_this.mergeOpt.isgeoroam) { //是否根据地图缩放比例显示节点

                        //
                        _this._zoomSwitch(_this.myChart.getOption().geo[0].zoom);

                        _this.myChart.on("georoam", function (params) {//地图缩放事件监听
                            _this.mapClickRip = false;
                            // roam：false
                            _this.mergeOpt.echartsMapOpt.geo.roam = false
                            if (!_this.mergeOpt.isgeoroam || _this.navArea.find("button[data-ctiy]").length > 1) return;
                            //if(_this.navArea.find('button:visible').length>0) return;//判断是否最顶级
                            if (params.dy || params.dx) return;//判断是否拖拽事件
                            var _option = _this.myChart.getOption();
                            var _zoom = _option.geo[0].zoom;
                            _this.mergeOpt.echartsMapOpt.geo.center = undefined;
                            _this.mergeOpt.echartsMapOpt.series[1].data = [];

                            if (_this.myZoom == _zoom) return;

                            if ((_this.myZoom < 2 && _zoom >= 2) || (_this.myZoom >= 2 && _zoom < 2)) {
                                console.log("缩放的层级是?", _zoom)
                                _this.myZoom = _zoom;
                                var cityname = _this.mergeOpt.echartsMapOpt.geo.map;
                                var cityId = cityMap[cityname];
                                _this._registerAndsetOption(_this.myChart, cityId, cityname, _this.mapJsonNow, false);
                                //最后一级没有id，暂时以此判断最后一层不显示聚合点的样式
                                _this._zoomSwitch(_this.myZoom);


                                _this.mergeOpt.echartsMapOpt.geo.roam = true
                                setTimeout(() => {

                                    _this.myChart.setOption(_this.mergeOpt.echartsMapOpt);
                                }, 1000);
                            }
                        });

                    }


                    //加载完毕
                    _this.mergeOpt.completed && _this.mergeOpt.completed();
                    //"返回上级"按钮点击事件
                    if (_this.btnBack) {
                        //返回上级
                        _this.btnBack.on('click', function () {
                            if (_this.navArea.find('button').length > 1)
                                _this.navArea.find('button:last').prev().click();
                        });
                    }
                }
            );

        },
        /**
         * 显示下级地图,主要用于地图区域点击或查询条件区域点击
         */
        _setMapJson: function (cityId, cityName, district) {//代表有下级地图
            if (cityId == '') cityId = cityMap[cityName];
            var _this = this;
            $.get(
                _this.mergeOpt.path + "json/" +
                cityId + ".json",
                function (mapJson) {
                    if (_this.navArea.find("button[data-ctiy='" + cityName + "']").length == 0 || typeof (district) != 'undefined') {
                        _this.myZoom = ((_this.navArea.find("button[data-ctiy]").length == 0) ? 1 : 2);
                        _this.myChart.clear(); //纠正拖拽地图下钻省份错位
                        _this.mapJsonNow = mapJson;
                        if (typeof (district) != 'undefined' && district != '') {
                            _this._setMapJsonSingle(district);//直接显示到县区
                        } else {
                            _this._registerAndsetOption(_this.myChart, cityId, cityName, mapJson, true);
                            //海岛太多处理一下
                            if (cityName.indexOf('海南') != -1) {
                                _this.myChart.setOption({
                                    geo: [{
                                        zoom: 8,
                                        center: [109.78162803787681, 19.271557756139828]
                                    }]
                                });
                            }
                        }
                        if (_this.navArea.find("button[data-ctiy='" + cityName + "']").length == 0)
                            _this.navArea.append("<button type='button' data-ctiy='" + cityName + "'>" + cityName + "</button>");

                        _this.navArea.show();
                        //最后一级没有id，暂时以此判断最后一层不显示聚合点的样式
                        _this._zoomSwitch(_this.myZoom);
                        if (_this.btnBack) {//显示返回上级按钮
                            _this.btnBack.removeClass("hide");
                        }
                        _this.navArea.find("button[data-ctiy='" + cityName + "']").on("click", function (e) {
                            _this.myZoom = (($(e.target).prevAll('button[data-ctiy]').length == 0) ? 1 : 2);
                            _this.myChart.clear(); //纠正拖拽地图下钻省份错位
                            _this.mapJsonNow = mapJson;
                            _this._registerAndsetOption(_this.myChart, cityId, cityName, mapJson, true);
                            //海岛太多处理一下
                            if (cityName.indexOf('海南') != -1) {
                                _this.myChart.setOption({
                                    geo: [{
                                        zoom: 8,
                                        center: [109.78162803787681, 19.271557756139828]
                                    }]
                                });
                            }
                            $(e.target).nextAll("button").remove();
                            //最后一级没有id，暂时以此判断最后一层不显示聚合点的样式
                            _this._zoomSwitch(_this.myZoom);
                        });
                    }
                }
            );
        },
        /**
         * 显示单个区域地图,主要用于显示无下级的县区等
         */
        _setMapJsonSingle: function (district) {
            var _this = this;
            _this.myChart.clear(); //纠正拖拽地图下钻省份错位
            var mapJson = ({ type: "FeatureCollection", features: [] });
            _this.mapJsonNow.features.forEach(function (item, index, arr) {
                if (district == item.properties.name)
                    mapJson.features.push(item);
            });
            _this._registerAndsetOption(_this.myChart, '', district, mapJson, true);
        },
        /**
         * 滚轮放大缩小触发样式变化
         * 最后一级地图时，z统一传2，使其不显示聚合点的样式
         */
        _zoomSwitch: function (z) {
            //图标大小
            var _this = this;
            var _symbolSize = 24;

            //设置定时器 确保插件生成完成 再设置
            setTimeout(
                function () {
                    if (z < 2) { //缩放小的情况
                        _this.myChart.setOption({
                            series: [{
                                symbolSize: _symbolSize + 15,
                                label: {
                                    normal: {
                                        show: _this.mergeOpt.isgeoroam ? true : false
                                    },
                                    emphasis: {
                                        show: _this.mergeOpt.isgeoroam ? true : false
                                    }
                                }
                            }]
                        });
                    } else { //缩放大的情况
                        _this.myChart.setOption({
                            series: [{
                                symbolSize: _symbolSize,
                                label: {
                                    normal: {
                                        show: false
                                    },
                                    emphasis: {
                                        show: false
                                    }
                                }
                            }]
                        });
                    }
                }, 100
            );
        },
        /**
         *
         * @param {*} myChart   地图实例
         * @param {*} id        省市县Id
         * @param {*} name      省市县名称
         * @param {*} mapJson   地图Json数据
         * @param {*} flag      是否往mapStack里添加parentId，parentName
         */
        _registerAndsetOption: function (myChart, id, name, mapJson, flag) {

            var _this = this;
            //地图名称重新赋值
            _this.mergeOpt.echartsMapOpt.geo.map = name;
            if (id != '') {
                _this.parentId = id;
                _this.parentName = name;
            }
            registerMap(name, mapJson);
            myChart.setOption(
                _this.mergeOpt.echartsMapOpt
            );
            myChart.setOption({
                series: [{
                    data: _this._initMapData(mapJson)
                }, {
                    data: _this._initMapDataRippling(mapJson)
                }]
            });
        },
        /**
          *  根据Json 里的数据构造echarts 地图 涟漪效果
          */
        _initMapDataRippling: function (mapJson) {
            console.log("涟漪???");
            if (!mapJson) return [];
            if (typeof (mapJson) == "string") mapJson = JSON.parse(mapJson)
            var _this = this;
            var res = [];
            var res1 = [];
            var flag = (_this.chinadata.length == 0);//判断是否存在
            for (var i = 0; i < mapJson.features.length; i++) {
                var cityArea = mapJson.features[i].properties.name;
                var arr = _this._recursiveMap(_this.mergeOpt.data, cityArea);
                for (var j = 0; j < arr.length; j++) {
                    var _name = arr[j].name;
                    var _value = arr[j].value;
                    var _lal = arr[j].lal;
                    var _xmid = arr[j].xmid;
                    var _symbol = arr[j].symbol;
                    res.push({
                        xmid: _xmid,
                        symbol: _symbol,
                        name: _name,
                        value: _lal.concat(((_value) ? _value : ""))
                    });
                }
                if (mapJson.features[i].id && arr.length > 0) {
                    res1.push({
                        name: cityArea,
                        value: mapJson.features[i].properties.cp.concat(arr.length),
                        data: arr
                    });
                }
                if (flag && arr.length > 0) {
                    _this.chinadata.push({
                        name: cityArea,
                        value: mapJson.features[i].properties.cp.concat(arr.length),
                        data: arr
                    });
                }
            }
            let lianyiData = []
            if (_this.myZoom > 2 && res.length > 0 || _this.mapClickRip) {
                for (let i = 0; i < res.length; i++) {
                    lianyiData.push({
                        value: [res[i].value[0], res[i].value[1]]
                    })
                }
                _this.mergeOpt.echartsMapOpt.series[1].data = lianyiData;
            } else {
                _this.mergeOpt.echartsMapOpt.series[1].data = res1;
            }
            return ((res1.length > 0 && _this.mergeOpt.isgeoroam && (_this.myZoom < 2)) ? res1 : lianyiData);
        },
        /**
         * 根据Json里的数据构造Echarts地图所需要的数据
         * @param {*} mapJson
         */
        _initMapData: function (mapJson) {
            if (!mapJson) return [];
            if (typeof (mapJson) == "string") mapJson = JSON.parse(mapJson)
            var _this = this;
            var res = [];
            var res1 = [];
            var flag = (_this.chinadata.length == 0);//判断是否存在
            for (var i = 0; i < mapJson.features.length; i++) {
                var cityArea = mapJson.features[i].properties.name;
                var arr = _this._recursiveMap(_this.mergeOpt.data, cityArea);
                for (var j = 0; j < arr.length; j++) {
                    var _name = arr[j].name;
                    var _value = arr[j].value;
                    var _lal = arr[j].lal;
                    var _xmid = arr[j].xmid;
                    var _symbol = arr[j].symbol;
                    res.push({
                        xmid: _xmid,
                        symbol: _symbol,
                        name: _name,
                        value: _lal.concat(((_value) ? _value : ""))
                    });
                }
                if (mapJson.features[i].id && arr.length > 0) {
                    res1.push({
                        name: cityArea,
                        value: mapJson.features[i].properties.cp.concat(arr.length),
                        data: arr
                    });
                }
                if (flag && arr.length > 0) {
                    _this.chinadata.push({
                        name: cityArea,
                        value: mapJson.features[i].properties.cp.concat(arr.length),
                        data: arr
                    });
                }
            }
            return ((res1.length > 0 && _this.mergeOpt.isgeoroam && (_this.myZoom < 2)) ? res1 : res);
            //return res;
        },
        /**
         * 递归返回坐标
         * @param {object} mapObj
         * @param {string} cityArea
         */
        _recursiveMap: function (mapObj, cityArea) {
            var _this = this;
            var arr = []; //散点图数组
            recursive(mapObj, _this.parentName);
            function recursive(mapObj, parentName, flag) {
                for (var i in mapObj) {
                    if (mapObj[i].constructor == Object) {
                        if (i == parentName || flag) {
                            recursive(mapObj[i], cityArea, (parentName == cityArea));
                        } else {
                            recursive(mapObj[i], parentName);
                        }
                    } else if (mapObj[i].constructor == Array && flag) {
                        for (var j = 0; j < mapObj[i].length; j++) {
                            arr.push(mapObj[i][j]);
                        }
                    }
                }
            }
            return arr;
        },
        /**
         * 返回最上级地图
         */
        _back: function (e) {
            var _this = this;
            if (!_this.mergeOpt.echartsMapOpt.geo.roam) {
                _this.mergeOpt.echartsMapOpt.geo.roam = true
                setTimeout(() => {
                    _this.myChart.setOption(_this.mergeOpt.echartsMapOpt);
                }, 1000);
            }
            _this.myChart.clear(); //纠正放大缩小地图后回到中国还处于缩放比例的状态
            _this.myZoom = 1;
            _this._zoomSwitch(_this.myZoom);
            $.get(
                _this.mergeOpt.path + "json/" +
                _this.chinaId + ".json",
                function (mapJson) {
                    _this.mapJsonNow = mapJson;
                    _this._registerAndsetOption(_this.myChart, _this.chinaId, _this.chinaName, mapJson, false);
                    //返回上一级后，父级的ID、Name随之改变
                    _this.parentId = _this.chinaId;
                    _this.parentName = _this.chinaName;
                }
            );
            _this.navArea.hide();
            $(e).nextAll().remove();
            if (_this.btnBack) //隐藏返回上级按钮
                _this.btnBack.addClass("hide");
        },
        /**
         * 默认刷新数据，传参刷新指定参数
         */
        refresh: function (opt) {
            if (!this.mapJsonNow) return;
            var _this = this;
            var def = {
                series: [{
                    data: _this._initMapData(_this.mapJsonNow)
                },
                {
                    data: _this._initMapDataRippling(_this.mapJsonNow)
                }]
            }
            //判断是否有存入对象进行合并
            if (opt) {
                def = $.extend(true, def, opt);
            }
            _this.myChart.setOption(
                def
            );

        }

    }

    window.MapSurvey = MapSurvey;

    //地区对应的Json编号
    var cityMap = {
        "安徽": "340000",
        "澳门": '820000',
        "北京": '110000',
        "重庆": '500000',
        "福建": '350000',
        "甘肃": '620000',
        "广东": '440000',
        "广西": "450000",
        "贵州": '520000',
        "海南": '460000',
        "河北": '130000',
        "黑龙江": '230000',
        "河南": '410000',
        "湖北": '420000',
        "湖南": '430000',
        "江苏": '320000',
        "江西": '360000',
        "吉林": '220000',
        "辽宁": '210000',
        "内蒙古": '150000',
        "宁夏": '640000',
        "青海": '630000',
        "山东": '370000',
        "上海": '310000',
        "山西": '140000',
        "四川": '510000',
        "台湾": '710000',
        "天津": '120000',
        "新疆": '650000',
        "陕西": '610000',
        "西藏": '540000',
        "云南": '530000',
        "浙江": '330000',
        "香港": '810000',
        "北京市": "110100",
        "天津市": "120100",
        "上海市": "310100",
        "重庆市": "500100",
        "崇明县": "310200",
        "湖北省直辖县市": "429000",
        "铜仁市": "522200",
        "毕节市": "522400",
        "石家庄市": "130100",
        "唐山市": "130200",
        "秦皇岛市": "130300",
        "邯郸市": "130400",
        "邢台市": "130500",
        "保定市": "130600",
        "张家口市": "130700",
        "承德市": "130800",
        "沧州市": "130900",
        "廊坊市": "131000",
        "衡水市": "131100",
        "太原市": "140100",
        "大同市": "140200",
        "阳泉市": "140300",
        "长治市": "140400",
        "晋城市": "140500",
        "朔州市": "140600",
        "晋中市": "140700",
        "运城市": "140800",
        "忻州市": "140900",
        "临汾市": "141000",
        "吕梁市": "141100",
        "呼和浩特市": "150100",
        "包头市": "150200",
        "乌海市": "150300",
        "赤峰市": "150400",
        "通辽市": "150500",
        "鄂尔多斯市": "150600",
        "呼伦贝尔市": "150700",
        "巴彦淖尔市": "150800",
        "乌兰察布市": "150900",
        "兴安盟": "152200",
        "锡林郭勒盟": "152500",
        "阿拉善盟": "152900",
        "沈阳市": "210100",
        "大连市": "210200",
        "鞍山市": "210300",
        "抚顺市": "210400",
        "本溪市": "210500",
        "丹东市": "210600",
        "锦州市": "210700",
        "营口市": "210800",
        "阜新市": "210900",
        "辽阳市": "211000",
        "盘锦市": "211100",
        "铁岭市": "211200",
        "朝阳市": "211300",
        "葫芦岛市": "211400",
        "长春市": "220100",
        "吉林市": "220200",
        "四平市": "220300",
        "辽源市": "220400",
        "通化市": "220500",
        "白山市": "220600",
        "松原市": "220700",
        "白城市": "220800",
        "延边朝鲜族自治州": "222400",
        "哈尔滨市": "230100",
        "齐齐哈尔市": "230200",
        "鸡西市": "230300",
        "鹤岗市": "230400",
        "双鸭山市": "230500",
        "大庆市": "230600",
        "伊春市": "230700",
        "佳木斯市": "230800",
        "七台河市": "230900",
        "牡丹江市": "231000",
        "黑河市": "231100",
        "绥化市": "231200",
        "大兴安岭地区": "232700",
        "南京市": "320100",
        "无锡市": "320200",
        "徐州市": "320300",
        "常州市": "320400",
        "苏州市": "320500",
        "南通市": "320600",
        "连云港市": "320700",
        "淮安市": "320800",
        "盐城市": "320900",
        "扬州市": "321000",
        "镇江市": "321100",
        "泰州市": "321200",
        "宿迁市": "321300",
        "杭州市": "330100",
        "宁波市": "330200",
        "温州市": "330300",
        "嘉兴市": "330400",
        "湖州市": "330500",
        "绍兴市": "330600",
        "金华市": "330700",
        "衢州市": "330800",
        "舟山市": "330900",
        "台州市": "331000",
        "丽水市": "331100",
        "合肥市": "340100",
        "芜湖市": "340200",
        "蚌埠市": "340300",
        "淮南市": "340400",
        "马鞍山市": "340500",
        "淮北市": "340600",
        "铜陵市": "340700",
        "安庆市": "340800",
        "黄山市": "341000",
        "滁州市": "341100",
        "阜阳市": "341200",
        "宿州市": "341300",
        "六安市": "341500",
        "亳州市": "341600",
        "池州市": "341700",
        "宣城市": "341800",
        "福州市": "350100",
        "厦门市": "350200",
        "莆田市": "350300",
        "三明市": "350400",
        "泉州市": "350500",
        "漳州市": "350600",
        "南平市": "350700",
        "龙岩市": "350800",
        "宁德市": "350900",
        "南昌市": "360100",
        "景德镇市": "360200",
        "萍乡市": "360300",
        "九江市": "360400",
        "新余市": "360500",
        "鹰潭市": "360600",
        "赣州市": "360700",
        "吉安市": "360800",
        "宜春市": "360900",
        "抚州市": "361000",
        "上饶市": "361100",
        "济南市": "370100",
        "青岛市": "370200",
        "淄博市": "370300",
        "枣庄市": "370400",
        "东营市": "370500",
        "烟台市": "370600",
        "潍坊市": "370700",
        "济宁市": "370800",
        "泰安市": "370900",
        "威海市": "371000",
        "日照市": "371100",
        "莱芜市": "371200",
        "临沂市": "371300",
        "德州市": "371400",
        "聊城市": "371500",
        "滨州市": "371600",
        "菏泽市": "371700",
        "郑州市": "410100",
        "开封市": "410200",
        "洛阳市": "410300",
        "平顶山市": "410400",
        "安阳市": "410500",
        "鹤壁市": "410600",
        "新乡市": "410700",
        "焦作市": "410800",
        "濮阳市": "410900",
        "许昌市": "411000",
        "漯河市": "411100",
        "三门峡市": "411200",
        "南阳市": "411300",
        "商丘市": "411400",
        "信阳市": "411500",
        "周口市": "411600",
        "驻马店市": "411700",
        "省直辖县级行政区划": "469000",
        "武汉市": "420100",
        "黄石市": "420200",
        "十堰市": "420300",
        "宜昌市": "420500",
        "襄阳市": "420600",
        "鄂州市": "420700",
        "荆门市": "420800",
        "孝感市": "420900",
        "荆州市": "421000",
        "黄冈市": "421100",
        "咸宁市": "421200",
        "随州市": "421300",
        "恩施土家族苗族自治州": "422800",
        "长沙市": "430100",
        "株洲市": "430200",
        "湘潭市": "430300",
        "衡阳市": "430400",
        "邵阳市": "430500",
        "岳阳市": "430600",
        "常德市": "430700",
        "张家界市": "430800",
        "益阳市": "430900",
        "郴州市": "431000",
        "永州市": "431100",
        "怀化市": "431200",
        "娄底市": "431300",
        "湘西土家族苗族自治州": "433100",
        "广州市": "440100",
        "韶关市": "440200",
        "深圳市": "440300",
        "珠海市": "440400",
        "汕头市": "440500",
        "佛山市": "440600",
        "江门市": "440700",
        "湛江市": "440800",
        "茂名市": "440900",
        "肇庆市": "441200",
        "惠州市": "441300",
        "梅州市": "441400",
        "汕尾市": "441500",
        "河源市": "441600",
        "阳江市": "441700",
        "清远市": "441800",
        "东莞市": "441900",
        "中山市": "442000",
        "潮州市": "445100",
        "揭阳市": "445200",
        "云浮市": "445300",
        "南宁市": "450100",
        "柳州市": "450200",
        "桂林市": "450300",
        "梧州市": "450400",
        "北海市": "450500",
        "防城港市": "450600",
        "钦州市": "450700",
        "贵港市": "450800",
        "玉林市": "450900",
        "百色市": "451000",
        "贺州市": "451100",
        "河池市": "451200",
        "来宾市": "451300",
        "崇左市": "451400",
        "海口市": "460100",
        "三亚市": "460200",
        "三沙市": "460300",
        "成都市": "510100",
        "自贡市": "510300",
        "攀枝花市": "510400",
        "泸州市": "510500",
        "德阳市": "510600",
        "绵阳市": "510700",
        "广元市": "510800",
        "遂宁市": "510900",
        "内江市": "511000",
        "乐山市": "511100",
        "南充市": "511300",
        "眉山市": "511400",
        "宜宾市": "511500",
        "广安市": "511600",
        "达州市": "511700",
        "雅安市": "511800",
        "巴中市": "511900",
        "资阳市": "512000",
        "阿坝藏族羌族自治州": "513200",
        "甘孜藏族自治州": "513300",
        "凉山彝族自治州": "513400",
        "贵阳市": "520100",
        "六盘水市": "520200",
        "遵义市": "520300",
        "安顺市": "520400",
        "黔西南布依族苗族自治州": "522300",
        "黔东南苗族侗族自治州": "522600",
        "黔南布依族苗族自治州": "522700",
        "昆明市": "530100",
        "曲靖市": "530300",
        "玉溪市": "530400",
        "保山市": "530500",
        "昭通市": "530600",
        "丽江市": "530700",
        "普洱市": "530800",
        "临沧市": "530900",
        "楚雄彝族自治州": "532300",
        "红河哈尼族彝族自治州": "532500",
        "文山壮族苗族自治州": "532600",
        "西双版纳傣族自治州": "532800",
        "大理白族自治州": "532900",
        "德宏傣族景颇族自治州": "533100",
        "怒江傈僳族自治州": "533300",
        "迪庆藏族自治州": "533400",
        "拉萨市": "540100",
        "昌都地区": "542100",
        "山南地区": "542200",
        "日喀则地区": "542300",
        "那曲地区": "542400",
        "阿里地区": "542500",
        "林芝地区": "542600",
        "西安市": "610100",
        "铜川市": "610200",
        "宝鸡市": "610300",
        "咸阳市": "610400",
        "渭南市": "610500",
        "延安市": "610600",
        "汉中市": "610700",
        "榆林市": "610800",
        "安康市": "610900",
        "商洛市": "611000",
        "兰州市": "620100",
        "嘉峪关市": "620200",
        "金昌市": "620300",
        "白银市": "620400",
        "天水市": "620500",
        "武威市": "620600",
        "张掖市": "620700",
        "平凉市": "620800",
        "酒泉市": "620900",
        "庆阳市": "621000",
        "定西市": "621100",
        "陇南市": "621200",
        "临夏回族自治州": "622900",
        "甘南藏族自治州": "623000",
        "西宁市": "630100",
        "海东地区": "632100",
        "海北藏族自治州": "632200",
        "黄南藏族自治州": "632300",
        "海南藏族自治州": "632500",
        "果洛藏族自治州": "632600",
        "玉树藏族自治州": "632700",
        "海西蒙古族藏族自治州": "632800",
        "银川市": "640100",
        "石嘴山市": "640200",
        "吴忠市": "640300",
        "固原市": "640400",
        "中卫市": "640500",
        "乌鲁木齐市": "650100",
        "克拉玛依市": "650200",
        "吐鲁番市": "650400",
        "哈密市": "650500",
        "昌吉回族自治州": "652300",
        "博尔塔拉蒙古自治州": "652700",
        "巴音郭楞蒙古自治州": "652800",
        "阿克苏地区": "652900",
        "克孜勒苏柯尔克孜自治州": "653000",
        "喀什地区": "653100",
        "和田地区": "653200",
        "伊犁哈萨克自治州": "654000",
        "塔城地区": "654200",
        "阿勒泰地区": "654300",
        "自治区直辖县级行政区划": "659000",
        "台湾省": "710000",
        "香港特别行政区": "810100",
        "澳门特别行政区": "820000",
        "山南市": "540500",
        "日喀则市": "540200",
        "林芝市": "540400",
        "昌都市": "540300"
    }

}());










